package edu.byu.intex2.data.bo;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.dao.UsedCarDAO;

/**
 * @author Jason Whiting
 */
public class UsedCar extends PhysicalCar
{

    private String carCondition;
    private int mileage;

    /**
     * Creates a new instance of BusinessObject
     * @param id
     */
    public UsedCar(String id)
    {
        super(id);
    }//constructor

    //Quick Access Method
    @Override
    public void save() throws DataException
    {
        try
        {
            UsedCarDAO.getInstance().save(this);
        } catch (DataException e)
        {
            e.printStackTrace();
        }
    }

    /** @return the carCondition     */
    public String getCarCondition()
    {
        return carCondition;
    }

    /** @param carCondition the carCondition to set     */
    public void setCarCondition(String carCondition)
    {
        this.carCondition = carCondition;
        setDirty();
    }

    /** @return the mileage     */
    public int getMileage()
    {
        return mileage;
    }

    /** @param mileage the mileage to set     */
    public void setMileage(int mileage)
    {
        this.mileage = mileage;
        setDirty();
    }
}
